// package com->alibaba->druid->sql->ast;

// import com->alibaba->druid->sql->ast->statement->SQLSelectItem*;
// import com->alibaba->druid->sql->visitor->SQLASTVisitor;

// import java->util->ArrayList;
// import java->util->std::list;
#pragma once

#include <string>
#include <list>

#include "SQLObjectImpl.h"
#include "SQLHint.h"
#include "Object.h"
#include "SQLExpr.h"

#include "statement/SQLSelectItem.h"
class SQLASTVisitor;


class SQLUnpivot_NullsIncludeType
{
public:
  static SQLUnpivot_NullsIncludeType_ptr INCLUDE_NULLS;
  static SQLUnpivot_NullsIncludeType_ptr EXCLUDE_NULLS;

  SQLUnpivot_NullsIncludeType() {}
  SQLUnpivot_NullsIncludeType(uint64_t mask, string_ptr name);
  uint64_t mask;
  string_ptr name;
  static string_ptr toString(SQLUnpivot_NullsIncludeType_ptr type, bool ucase);
  bool equals(SQLUnpivot_NullsIncludeType_ptr type);
};

class SQLUnpivot : virtual public SQLObjectImpl
{
public:

  SQLUnpivot_NullsIncludeType_ptr nullsIncludeType;
  SQLExpr_list_ptr items;
  SQLExpr_list_ptr pivotFor;
  SQLSelectItem_list_ptr pivotIn;

  SQLUnpivot();
  SHAREDOBJECT(SQLUnpivot);
  void accept0(SQLASTVisitor_ptr v);

  SQLUnpivot_NullsIncludeType_ptr getNullsIncludeType();

  void setNullsIncludeType(SQLUnpivot_NullsIncludeType_ptr nullsIncludeType);

  SQLExpr_list_ptr getPivotFor();

  SQLSelectItem_list_ptr getPivotIn();

  SQLExpr_list_ptr getItems();

  void addItem(SQLExpr_ptr item);

  virtual SQLObject_ptr clone();
};
